﻿using Kw.Combinatorics;
using System;

namespace Kw.CombinatoricsExamples
{
    class PermutationExample03
    {
        static void Main ()
        {
            Permutation perm = new Permutation (6);

            perm.Rank = 9;
            Console.WriteLine (perm);

            for (int i = 0; i < perm.Width; ++i)
                Console.WriteLine (perm[i]);

            perm.Rank = -1;
            Console.WriteLine ("\nMaximum Rank = " + perm.Rank);
        }

        /* Output:
        { 0, 1, 3, 4, 5, 2 }
        0
        1
        3
        5
        2
        4

        Maximum Rank = 719
        */
    }
}
